<!--{template /module/admin/view/head}-->
<div id="left_layout">
	<div id="main_content" class="container-fluid">
		<!--{template /module/admin/view/head_nav}-->
		<div class="row-fluid">
			<form method="post" action="{$ADMIN_SCRIPT}/user/credit/_add" onsubmit="javascript:return check_form(this);">
			<input type="hidden" name="formsubmit" value="yes" />
				<div class="well widget">
					<div class="widget-header">
						<p class="text">* {lang admin.validate.require}</p>
					</div>
					<div class="widget-content">
					<fieldset>
						<label>{lang user.credit_edit.view.username.label} *</label>
						<input type="text" class="input"  name="txtUserName" placeholder="{lang user.credit_edit.view.username.placeholder}" maxlength="30"  /> 
						<span class="help-inline">{lang user.credit_edit.view.username.tips}</span>
						
						<label>{lang user.credit_edit.view.credit.label} *</label>
						<input type="text" class="input-medium"  name="txtCredit" maxlength="6" placeholder="{lang user.credit_edit.view.credit.placeholder}" /> 
						<span class="help-inline">{lang user.credit_edit.view.credit.tips}</span>
						
						<label>{lang user.credit_edit.view.score.label} *</label>
						<input type="text" class="input-medium"  name="txtScore" maxlength="6" placeholder="{lang user.credit_edit.view.score.placeholder}" /> 
						<span class="help-inline">{lang user.credit_edit.view.score.tips}</span>
						
						<label>{lang user.credit_edit.view.title.label} *</label>
						<input type="text" class="input-xxlarge" size="30" name="txtTitle"  placeholder="{lang user.credit_edit.view.title.placeholder}" maxlength="50" /> 
						<span class="help-inline">{lang user.credit_edit.view.title.tips}</span>
						
						<label>{lang user.credit_edit.view.remark.label}</label>
						<textarea class="span6" rows="2" cols="45" name="txtRemark"></textarea>
						<span class="help-inline">{lang user.credit_edit.view.remark.tips}</span>
					
						<hr />
						<button type="submit"  name="btnSubmit" id="btnSubmit" class="btn btn-small btn-primary" {$dispatches[operations][add]}>{lang admin.operation.submit}</button>
						<button type="reset" class="btn btn-small">{lang admin.operation.reset}</button>
						<button type="button" class="btn btn-small" onclick="javascript:location.href='{$ADMIN_SCRIPT}/user/credit&page={$_var[page]}&psize={$_var[psize]}{$search[querystring]}';">{lang admin.operation.go.back}</button>
					</fieldset>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>

<script>
	function check_form(frm){
	    if(frm.txtUserName.value.trim().length == 0){
			$(frm.txtUserName).next('.help-inline').css('color', 'red');
	    	frm.txtUserName.focus();
	    	return false;
	    }
    	
	    if(frm.txtTitle.value.trim().length == 0){
	    	$(frm.txtTitle).next('.help-inline').css('color', 'red');
        	frm.txtTitle.focus();
        	return false;
        }
	    
    	return true;
 	}
	
	$(function(){
		$('.fancy').uniform();

		$('fieldset input,textarea,select').blur(function() {
			$(this).next('.help-inline').css('color', '#333');
		});
	});
</script>
<!--{template /module/admin/view/foot}-->